package com.oocl.batchdatav2.analyzer.impl;

import java.util.Comparator;
import java.util.List;
import java.util.Set;
import java.util.TreeSet;

import com.oocl.batchdatav2.analyzer.DataAnalyzer;
import com.oocl.batchdatav2.pojo.Customer;

public class DataAnalyzerImpl implements DataAnalyzer {
	
	private List<Customer> customerList;
	
	public DataAnalyzerImpl(List<Customer> customerList) {
		this.customerList = customerList;
	}

	@Override
	public Set<Customer> sortBy(Comparator<Customer> comparator) {
		Set<Customer> result = new TreeSet<>(comparator);
		result.addAll(customerList);
		return result;
	}

}
